<?php
	$target_url = Utility::currentUrl();
?>
<div class="art-post">
	<div class="art-post-tl"></div>
	<div class="art-post-tr"></div>
	<div class="art-post-bl"></div>
	<div class="art-post-br"></div>
	<div class="art-post-tc"></div>
	<div class="art-post-bc"></div>
	<div class="art-post-cl"></div>
	<div class="art-post-cr"></div>
	<div class="art-post-cc"></div>
	<div class="art-post-body">
	<div class="art-post-inner art-article">  
	<!-- begin -->
<h2 class="art-postheader">[<?php echo ($action == 'add')?"Thêm đối tác":"Sửa thông tin đối tác"; ?>]</h2>
<?php
    if(isset($error))
    {
        foreach($error as $err)
        {
            ?>
            <span class="error-notification">* <?php echo $err; ?></span><br />
            <?php
        }
    }
    if(isset($message))
    {
        ?>
        <span class="message-notification">* <?php echo $message; ?></span><br/>
        <?php
    }
    echo "<br /><br />";
?>

<form action="<?php echo $target_url; ?>" method="POST">
<table>
	<tbody>
		<tr>
			<td>Tên đối tác</td>
			<td><input type="text" name="name" value="<?php if(isset($input)) echo ($action == 'add')?$input['name']:$input->name; ?>"/></td>
		</tr>
		<tr>
			<td>Chi tiết</td>
			<td><textarea name="description" cols="30" rows="10"><?php if(isset($input)) echo ($action == 'add')?$input['description']:$input->description; ?></textarea></td>
		</tr>
		<tr>
			<td>Email</td>
			<td><input type="text" name="email" value="<?php if(isset($input)) echo ($action == 'add')?$input['email']:$input->email; ?>" /></td>
		</tr>
		<?php
		$status = 1;
		if(isset($input))
			$status = ($action == 'add')?$input['status']:$input->status;
		?>
		<tr>
			<td>Trạng thái</td>
			<td>
				<select name="status">
					<option value="1" <?php if($status == 1) echo 'selected="selected"'; ?>>Kích hoạt</option>
					<option value="0" <?php if($status == 0) echo 'selected="selected"'; ?>>Không kích hoạt</option>
				</select>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>
				<input type="submit" name="submit" value="<?php echo ($action=='add')?"Thêm":"Sửa"; ?>" onclick="check()" />
				<input type="reset" value="Nhập lại"/>
                <input type="button" value="Quay lại danh sách" onclick="window.location='<?php echo Utility::getSiteUrl();?>/partner'"/>
			</td>
		</tr>
	</tbody>
</table>
</form>
<!-- end -->
</div>
  
		<div class="cleared"></div>
	  </div>
  </div>